<%--
  Created by IntelliJ IDEA.
  User: 石增
  Date: 2021/8/31
  Time: 14:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script>
        function add() {
            location.href="/brand_demo/addBrand.jsp";
        }
    </script>
</head>
<body>
<h1>${user.username}, 欢迎你</h1>
<input type="button" value="新增" onclick=add() ><br>
<hr>
<table border="1" cellspacing="0" width="70%">
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>

    </tr>

    <c:forEach items="${brands}" var="b">
        <tr align="center">
            <td>${b.id}</td>
            <td>${b.brandName}</td>
            <td>${b.companyName}</td>
            <td>${b.ordered}</td>
            <td>${b.description}</td>
            <c:if test="${b.status == 1}"><td>启用</td></c:if>
            <c:if test="${b.status == 0}"><td>禁用</td></c:if>
            <td><a href="/brand_demo/selectById?id=${b.id}">修改</a> <a href="/brand_demo/deleteBrand?id=${b.id}">删除</a></td>
        </tr>

    </c:forEach>



</table>


</body>
</html>
